|
ARD2
1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
|
FreeMASTER Driver main API header file, MPC56xx platform. More...
Go to the source code of this file.
Defines | |
| #define | FMSTR_PLATFORM_MPC56xx 1 |
| #define | FMSTR_APPCMDRESULT_NOCMD 0xff |
| #define | FMSTR_APPCMDRESULT_RUNNING 0xfe |
| #define | MFSTR_APPCMDRESULT_LASTVALID 0xf7 |
| #define | FMSTR_REC_BASE_SECONDS(x) ((x) & 0x3fff) |
| #define | FMSTR_REC_BASE_MILLISEC(x) (((x) & 0x3fff) | 0x4000) |
| #define | FMSTR_REC_BASE_MICROSEC(x) (((x) & 0x3fff) | 0x8000) |
| #define | FMSTR_REC_BASE_NANOSEC(x) (((x) & 0x3fff) | 0xc000) |
| #define | NULL ((void *) 0) |
Typedefs | |
| typedef unsigned char * | FMSTR_ADDR |
| typedef unsigned short | FMSTR_SIZE |
| typedef signed long | FMSTR_BOOL |
| typedef unsigned char | FMSTR_APPCMD_CODE |
| typedef unsigned char | FMSTR_APPCMD_DATA |
| typedef unsigned char * | FMSTR_APPCMD_PDATA |
| typedef unsigned char | FMSTR_APPCMD_RESULT |
| typedef FMSTR_APPCMD_RESULT(* | FMSTR_PAPPCMDFUNC )(FMSTR_APPCMD_CODE, FMSTR_APPCMD_PDATA, FMSTR_SIZE) |
Functions | |
| FMSTR_BOOL | FMSTR_Init (void) |
| FreeMASTER driver initialization. | |
| void | FMSTR_Poll (void) |
| void | FMSTR_Isr (void) |
| void | FMSTR_Recorder (void) |
| API: Recorder worker routine - can be called from application's timer ISR. | |
| void | FMSTR_TriggerRec (void) |
| API: Pull the trigger of the recorder. | |
| void | FMSTR_SetUpRecBuff (FMSTR_ADDR nBuffAddr, FMSTR_SIZE nBuffSize) |
| API: Replacing the recorder buffer with the user's one. | |
| FMSTR_APPCMD_CODE | FMSTR_GetAppCmd (void) |
| API: Fetch the application command code if one is ready for processing. | |
| FMSTR_APPCMD_PDATA | FMSTR_GetAppCmdData (FMSTR_SIZE *pDataLen) |
| API: Get a pointer to application command data. | |
| FMSTR_BOOL | FMSTR_RegisterAppCmdCall (FMSTR_APPCMD_CODE nAppCmdCode, FMSTR_PAPPCMDFUNC pCallbackFunc) |
| API: Register or unregister app.cmd callback handler. | |
| void | FMSTR_AppCmdAck (FMSTR_APPCMD_RESULT nResultCode) |
| API: Mark the application command is processed by the application. | |
| void | FMSTR_AppCmdSetResponseData (FMSTR_ADDR nResultDataAddr, FMSTR_SIZE nResultDataLen) |
| API: Mark the application command is processed by the application. | |
FreeMASTER Driver main API header file, MPC56xx platform.
This is the only header file needed to be included by the user application to implement the FreeMASTER interface. In addition, user has to write her "freemaster_cfg.h" configuration file and put it anywhere on the #include path
| void FMSTR_AppCmdAck | ( | FMSTR_APPCMD_RESULT | nResultCode | ) |
API: Mark the application command is processed by the application.
| nResultCode | - the result code which is returned to a host |
| void FMSTR_AppCmdSetResponseData | ( | FMSTR_ADDR | nResultDataAddr, |
| FMSTR_SIZE | nResultDataLen | ||
| ) |
API: Mark the application command is processed by the application.
| pResultDataAddr | - address of data we want to return to the PC |
| nResultDataLen | - length of return data |
| FMSTR_APPCMD_CODE FMSTR_GetAppCmd | ( | void | ) |
API: Fetch the application command code if one is ready for processing.
| FMSTR_APPCMD_PDATA FMSTR_GetAppCmdData | ( | FMSTR_SIZE * | pDataLen | ) |
API: Get a pointer to application command data.
| pDataLen | - A pointer to variable which receives the data length |
| void FMSTR_Recorder | ( | void | ) |
API: Recorder worker routine - can be called from application's timer ISR.
This returns quickly if recorder is not running, otherwise it calls quite lengthy recorder routine which does all the recorder work (sampling, triggering)
| FMSTR_BOOL FMSTR_RegisterAppCmdCall | ( | FMSTR_APPCMD_CODE | nAppCmdCode, |
| FMSTR_PAPPCMDFUNC | pCallbackFunc | ||
| ) |
API: Register or unregister app.cmd callback handler.
| nAppCmdCode | - App.command ID |
| pCallbackFunc | - Pointer to handler function (NULL to unregister) |
| void FMSTR_SetUpRecBuff | ( | FMSTR_ADDR | pBuffer, |
| FMSTR_SIZE | nBuffSize | ||
| ) |
API: Replacing the recorder buffer with the user's one.
| pBuffer | - user buffer pointer |
| wBuffSize | - buffer size |
| void FMSTR_TriggerRec | ( | void | ) |
API: Pull the trigger of the recorder.
This function starts the post-trigger stop countdown